//
//  ErrorView.m
//  Doctor1.0
//
//  Created by mk on 15/8/28.
//  Copyright (c) 2015年 cocoa-mk. All rights reserved.
//

#import "ErrorView.h"

@implementation ErrorView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
     
        CGFloat width = self.frame.size.width;
        CGFloat heigt = self.frame.size.height;
        
        self.errorImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, MK(380), MK(320))];
        self.errorImage.image = [UIImage imageNamed:@"error"];
        [self addSubview:self.errorImage];
      
        self.reloadButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.reloadButton.frame = CGRectMake( width / 4, 5 * heigt / 6 , width / 2, heigt / 8);
        [self.reloadButton setTintColor:[UIColor whiteColor]];
        [self.reloadButton setTitle:@"重新加载" forState:UIControlStateNormal];
        self.reloadButton.backgroundColor = [UIColor themeGreenColor];
        [self addSubview:self.reloadButton];
      
    }
    return self;
}
@end



